<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});

Route::namespace("Api")->group(function () {
    Route::prefix('admin')->group(function () {
        Route::post('test', "TestController@index");
        //用户登录
        Route::post('login', "LoginController@login");

        //菜单模块
        Route::post('/Menu/index', 'MenuController@menuList');//列表
        Route::post('/Menu/getEditInfo', 'MenuController@getEditInfo');//获取编辑页面
        Route::post('/Menu/addOrEdit', 'MenuController@addOrEdit');//添加或者编辑
        Route::post('/Menu/del', 'MenuController@menuDel');//删除
        Route::post('/Menu/getMenuList', 'MenuController@getMenuList');//获取上级菜单
        Route::post('/Menu/upStatus', 'MenuController@upStatus');//更改菜单状态

        //部门模块
        Route::post('/Dept/index', 'DeptController@deptList');//部门列表
        Route::post('/Dept/getDeptInfo', 'DeptController@deptInfo');//部门信息
        Route::post('/Dept/addOrEdit', 'DeptController@addOrEdit');//部门 添加或者编辑
        Route::post('/Dept/del', 'DeptController@deptDel');//部门 删除

        //角色模块
        Route::post('/Role/index', 'RoleController@roleList');//角色列表
        Route::post('/Role/getEditInfo', 'RoleController@getEditInfo');//角色 获取编辑
        Route::post('/Role/addOrEdit', 'RoleController@addOrEdit');//角色 添加或者编辑
        Route::post('/Role/del', 'RoleController@roleDel');//角色 删除

    });
});